package com.hzlj.position.locate.common.dto.positionNewest;

import com.fz.common.base.enums.db.*;
import com.fz.common.base.env.Env;
import com.hzlj.position.config.common.model.JzJbxxDeviceBind;
import com.hzlj.position.locate.common.model.PositionNewest;
import com.hzlj.sqjz.jz.common.model.JzJbxx;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

import static com.hzlj.sqjz.config.common.constant.Constant.JZZT_ZJ_ENV;

/**
 * 定位记录-分表(Position)查询参数DTO
 *
 * @author lifh
 * @date 2023-03-16 12:54:48
 */
@Data
@ToString
@Accessors(chain = true)
public class PositionNewestQueryParamDTO {
    /**
     * 机构ID全路径
     */
    @QueryField(model = JzJbxx.class,like = LikeType.RIGHT)
    private String jgCode;
    /**
     * 矫正ID(jz_jbxx)
     */
    @QueryField(model = JzJbxx.class,value = "id")
    private String jzId;
    /**
     * 矫正ID(jz_jbxx)
     */
    @QueryField(model = JzJbxx.class,in = InType.COMMA_ARRAY, value = "id")
    private List<String> jzIds;
    /**
     * 矫正人员名称
     */
    @QueryField(model = JzJbxx.class,like = LikeType.ALL)
    private String xm;
    /**
     * 是否是重点人员
     * 只能使用于获取最新定位记录
     */
    @QueryField(model = JzJbxx.class)
    private Boolean zdry;
    /**
     * 犯罪类型
     * 只能使用于获取最新定位记录
     */
    @QueryField(model = JzJbxx.class, findInSet = FindInSet.AND)
    private String fzlx;

    /**
     * 设备编号
     */
    @QueryField(model = JzJbxxDeviceBind.class,like = LikeType.ALL)
    private String deviceCode;
    /**
     * 定位渠道类型,dict-LOCATE_CHANNEL_TYPE
     */
    @QueryField(model = JzJbxxDeviceBind.class)
    private String channelType;
    /**
     * 定位渠道,dict-LOCATE_CHANNEL
     */
    @QueryField(model = JzJbxxDeviceBind.class)
    private String channel;
    /**
     * 告警类型,dict-LOCATE_WARNING_TYPE
     */
    @QueryField(model = PositionNewest.class)
    private String warningType;
    /**
     * 是否是告警记录
     */
    @QueryField(model = PositionNewest.class)
    private Boolean warning;
    /**
     * 处理状态,dict-HANDLE_STATUS
     */
    @QueryField(model = PositionNewest.class)
    private String handleStatus;
    /**
     * 开始时间
     */
    @QueryField(enable = EnableType.FALSE)
    private Date startPositionTime;
    /**
     * 结束时间
     */
    @QueryField(enable = EnableType.FALSE)
    private Date endPositionTime;
    /**
     * 是否有定位信息(定位表里面是否记录)
     */
    @QueryField(enable = EnableType.FALSE)
    private Boolean hasRecord;

    /**
     * 自定义的sql，忽略
     */
    private String jzzt= Env.getProperty(JZZT_ZJ_ENV);
    private String deviceCodeGroupSql;
    private String channelGroupSql;
    private String channelTypeGroupSql;
    private String sortSql;
    private String positionFormat;
}
